function dens = DensSVJEJ2(x,Price,Rate,DividendYield,Times,V0,ThetaV,Kappa,SigmaV,RhoSV,JumpFreq,mj,JumpVol,prob,mlow,slow,shigh)
%% ------------------------------description -----------------------------
%PDF of log-return implied by the SVJEJ2 model(inverse of the characteristic function)
%Price = current stock price
%Rate = interest rate
%DividendYield = dividend yield
%Times = time-to-maturity
%V0 = spot variance
%ThetaV = long-run variance
%Kappa = mean reversion
%SigmaV = volatility of volatility
%RhoSV = correlation coefficient between stock price and volatility
%JumpFreq = jump frequency
%mj = the mean jump size
%JumpVol = the jump size volatility
%prob = the probability of an downside jump
%mlow = the mean of the downside jump
%slow = the volatility of the upside jump
%shigh = the volatility of the upside jump
%Note: The mean of the upside jump is constrained by the other parameters so that the martingale restriction holds (see CFSVJEJ2).
%% -----------------------------------------------------------------------
AbsTol=1e-10;RelTol=1e-6;
CF=@(Phi)CFSVJEJ2(Phi,Price,Rate,DividendYield,Times,V0,ThetaV,Kappa,SigmaV,RhoSV,JumpFreq,mj,JumpVol,prob,mlow,slow,shigh,0);
IntegFun=@(Phi)real(exp(-1i.*Phi.*x).*CF(Phi).*exp(-1i.*Phi.*log(Price)));
dens=1./pi.*integral(IntegFun,1e-9,Inf,'AbsTol',AbsTol,'RelTol',RelTol,'ArrayValued',true);
end